<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:95:"D:\PHPTutorial\WWW\guyun\public/../application/admin\view\personalcenter\realNameCheckPage.html";i:1542616323;s:64:"D:\PHPTutorial\WWW\guyun\application\admin\view\common\head.html";i:1541553786;s:66:"D:\PHPTutorial\WWW\guyun\application\admin\view\common\footer.html";i:1515220430;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>上海顾云数据科技中心</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/admin/layui/css/layui.css">
    <link rel="stylesheet" href="/static/admin/build/css/app.css" media="all">
</head>
<style>
    .hidden{
        display: none;
    }

</style>

<div style="overflow-x: hidden;width: 96%;margin: auto;padding-top: 2rem;">
  <blockquote class="layui-elem-quote"><span>应用中心&nbsp;&nbsp;&nbsp;&nbsp;实名认证</span></blockquote>
  <div class="demoTable layui-form" style="margin-top: 1rem">
    <div style="margin-bottom: 1em"><b><span style="color: red;font-size: 20px">*</span>公司名称:</b></div>
    <input type="text" placeholder="公司名称" name="name" class="layui-input name" value="<?php echo $info['company_name']; ?>">
  </div>
  <div class="demoTable layui-form" style="margin-top: 1rem">
    <div style="margin-bottom: 1em"><b><span style="color: red;font-size: 20px">*</span>公司地址:</b></div>
    <input type="text" placeholder="公司地址" name="address" class="layui-input address" value="<?php echo $info['address']; ?>">
  </div>
  <div class="demoTable layui-form" style="margin-top: 1rem">
    <div style="margin-bottom: 1em"><b><span style="color: red;font-size: 20px">*</span>联系人姓名:</b></div>
    <input type="text" placeholder="联系人姓名" name="contect_people" class="layui-input contect_people" value="<?php echo $info['contect_people']; ?>">
  </div>
  <div class="demoTable layui-form" style="margin-top: 1rem">
    <div style="margin-bottom: 1em"><b><span style="color: red;font-size: 20px">*</span>联系人电话:</b></div>
    <input type="text" placeholder="联系人电话" name="contect_mobile" class="layui-input contect_mobile" value="<?php echo $info['mobile']; ?>">
  </div>
  <div class="demoTable layui-form" style="margin-top: 1rem">
    <div style="margin-bottom: 1em"><b><span style="color: red;font-size: 20px">*</span>社会统一编码:</b></div>
    <input type="text" placeholder="社会统一编码" name="sociel_code" class="layui-input sociel_code" value="<?php echo $info['social_unified_coding']; ?>">
  </div>
  <div class="demoTable layui-form" style="margin-top: 1rem">
    <div style="margin-bottom: 1em"><b>税务登记证编号:</b></div>
    <input type="text" placeholder="税务登记证编号" name="dengji_number" class="layui-input dengji_number" value="<?php echo $info['registration_certificate']; ?>">
  </div>
  <div class="demoTable layui-form" style="margin-top: 1rem">
    <div style="margin-bottom: 1em"><b>组织机构编号:</b></div>
    <input type="text" placeholder="组织机构编号" name="manager_number" class="layui-input manager_number" value="<?php echo $info['organization_number']; ?>">
  </div>
  <div class="demoTable layui-form" style="margin-top: 1em">
    <div style="margin-bottom: 1em"><b><span style="color: red;font-size: 20px">*</span>营业执照副本:</b></div>
    <div class="layui-upload-drag" id="upload">
      <i class="layui-icon"></i>
      <p>点击上传，或将文件拖拽到此处</p>
    </div>
    <div style="margin-bottom: 1em;margin-top: 1rem"><b>上传保存文件名:&nbsp;&nbsp;&nbsp;</b><span style="color: red;" class="file_name"> <?php echo $info['url']; ?></span></div>
  </div>
  <button class="layui-btn check" data-type="reload" style="margin-top: 0.5rem">提交认证信息</button>
</div>
    <script src="/static/admin/layui/layui.js"></script>
<script src="/static/common/js/jquery.min.js"></script>
<script>
//    图片放大显示
    $('.select_img').on('click',function () {
        var img_url=$(this).data('content');
        layer.open({
            type: 1,
            title: false,
            closeBtn: 0,
            area: ['50%','80%'],
            skin: 'layui-layer-nobg', //没有背景色
            shadeClose: true,
            content: '<img src="'+img_url+'" />',
        });
    })
    //文件上传
    layui.use('upload', function(){
        var $ = layui.jquery
            ,upload = layui.upload;
        //多文件列表示例
        var demoListView = $('#demoList')
            ,uploadListIns = upload.render({
            elem: '#testList'
            ,url: '<?php echo url("Upload/file_images"); ?>'
            ,accept: 'file'
            ,multiple: true
            ,auto: false
            ,bindAction: '#testListAction'
            ,choose: function(obj){
                var files = obj.pushFile(); //将每次选择的文件追加到文件队列
                //读取本地文件
                obj.preview(function(index, file, result){
                    var tr = $(['<tr id="upload-'+ index +'">'
                        ,'<td>'+ file.name +'</td>'
                        ,'<td>'+ (file.size/1014).toFixed(1) +'kb</td>'
                        ,'<td>等待上传</td>'
                        ,'<td>'
                        ,'<button class="layui-btn layui-btn-mini demo-reload layui-hide">重传</button>'
                        ,'<button class="layui-btn layui-btn-mini layui-btn-danger demo-delete">删除</button>'
                        ,'</td>'
                        ,'</tr>'].join(''));

                    //单个重传
                    tr.find('.demo-reload').on('click', function(){
                        obj.upload(index, file);
                    });

                    //删除
                    tr.find('.demo-delete').on('click', function(){
                        delete files[index]; //删除对应的文件
                        tr.remove();
                    });

                    demoListView.append(tr);
                });
            }
            ,done: function(res, index, upload){
                if(res.code == 200){ //上传成功
                    var tr = demoListView.find('tr#upload-'+ index)
                        ,tds = tr.children();
                    tds.eq(2).html('<span style="color: #5FB878;">上传成功</span><input type="hidden" name="images['+index+']" value="'+res.data.src+'">');
                    tds.eq(3).html(''); //清空操作
                    delete files[index]; //删除文件队列已经上传成功的文件
                    return;
                }
                this.error(index, upload);
            }
            ,error: function(index, upload){
                var tr = demoListView.find('tr#upload-'+ index)
                    ,tds = tr.children();
                tds.eq(2).html('<span style="color: #FF5722;">上传失败</span>');
                tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
            }
        });

        //普通图片上传 单图片上传
        var uploadInst = upload.render({
            elem: '#image'
            ,url: '<?php echo url("Upload/file_images"); ?>'
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function(index, file, result){
                    $('#show_image').attr('src', result); //图片链接（base64）
                });
            }
            ,done: function(res){
                //如果上传失败
                if(res.code == 400){
                    return layer.msg('上传失败');
                }
                $('.value_image').val(res.data.src);
                //上传成功
            }
            ,error: function(){
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
        });
    });
</script>

<script src="/static/admin/jquery.js"></script>
<script>
    layui.use('upload', function(){
        var upload = layui.upload;
        //执行实例
        var uploadInst = upload.render({
            elem: '#upload' //绑定元素
            ,url: '<?php echo url("Personalcenter/upload"); ?>' //上传接口
            ,done: function(res){
                //上传完毕回调
                if(res.code == 1){
                    layer.msg('上传成功!')
                    $('.file_name').html(res.savename);
                }
            }
            ,accept: ''
            ,error: function(res){
                //请求异常回调
                console.log(res)
            }
        });
    });
    $('.check').click(function(){
        var name = $('.name').val();
        var address = $('.address').val();
        var contect_people = $('.contect_people').val();
        var contect_mobile = $('.contect_mobile').val();
        var sociel_code = $('.sociel_code').val();
        var dengji_number = $('.dengji_number').val();
        var manager_number = $('.manager_number').val();
        var url = $('.file_name').text();
        if(!name || !url || !address || !contect_people || !contect_mobile || !sociel_code){
            layer.msg('请填写完整信息!');
        }else{
            $.ajax({
                url: '<?php echo url("Personalcenter/addFileLog"); ?>',
                dataType: 'json',
                type: 'post',
                // async:false,
                data: {'name':name,'url':url,'address':address,'contect_people':contect_people,'contect_mobile':contect_mobile,'sociel_code':sociel_code,'dengji_number':dengji_number,'manager_number':manager_number},
                success: function (data){
                    layer.msg(data.msg);

                }
            });
        }

    });
</script>
</body>
</html>